<div class="row wrapper white-bg page-heading">
  <div class="container-fluid">
    <h2>订单列表</h2>
  </div>
  <br>
  <div class="container-fluid">
    <table class="table table-hover">
      <thead>
      <tr>
        <th>订单号</th>
        <th>用户名</th>
        <th>手机号码</th>
        <th>价格</th>
        <th>创建时间</th>
        <th>订单状态</th>
        <th>操作</th>
      </tr>
      </thead>
      <tfoot></tfoot>
      <tbody>
      <tr ng-repeat="item in orderListCtrl.orderList">
        <td style="max-width:200px;min-width:50px;">{{item.orderNo}}</td>
        <td>{{item.username}}</td>
        <td>{{item.phoneNumber}}</td>
        <td>{{item.totalPrice/100}}</td>
        <td>{{item.createTime}}</td>
        <td style="color:#a94442;font-weight: bold; " ng-if="item.orderStatus=='NONPAYMENT'">未支付</td>
        <td style="color:red;font-weight: bold; " ng-if="item.orderStatus=='WAITDELIVER'">待发货</td>
        <td style="color:#31708f;font-weight: bold; " ng-if="item.orderStatus=='WAITRECEIVE'">待收货</td>
        <td style="color:#3c763d;font-weight: bold; " ng-if="item.orderStatus=='ORDERFINISH'">交易完成</td>
        <td>
        	<button class="btn btn-warning btn-sm" ng-if="item.orderStatus=='NONPAYMENT'" ng-click="orderListCtrl.changeStatus1(item.orderNo)">待付款</button>
        	<button class="btn btn-info btn-sm" ng-if="item.orderStatus=='WAITDELIVER'" ng-click="orderListCtrl.changeStatus2(item.orderNo)">待发货</button>
          <button class="btn btn-info btn-sm" ui-sref="home.order.orderAdd({orderNo:item.orderNo})">查看详情</button>
        </td>
      </tr>
      </tbody>
    </table>
  </div>
  <div class="container-fluid">
    <div class="col-md-12">
      <div class="fenyeBox" ng-show="orderListCtrl.totalNum != 0">
        <div class="pull-left">
          总条数：
          <strong> {{ orderListCtrl.totalNum}} </strong>条，共
          <strong> {{ orderListCtrl.pageResult.totalPage}}</strong>
          页，当前第
          <strong>{{ orderListCtrl.pageNo}}</strong> 页
        </div>
        <div class="pull-right" ng-show="orderListCtrl.pageResult.totalPage > 1">
          <ul class="pagination">
            <li>
              <button class="btn btn-white btn-bitbucket" ng-disabled=" orderListCtrl.pageNo==1"
                      ng-click="orderListCtrl.changePage(1)">
                首页
              </button>
            </li>
            <li>
              <button class="btn btn-white btn-bitbucket" ng-disabled=" orderListCtrl.pageNo==1"
                      ng-click="orderListCtrl.changePage(orderListCtrl.pageNo-1)">
                上一页
              </button>
            </li>
            <li ng-repeat="page in  orderListCtrl.pageResult.pages">
              <button ng-click="orderListCtrl.changePage(page)" class="btn btn-white btn-bitbucket"
                      ng-disabled="orderListCtrl.pageNo == page">{{page}}
              </button>
            </li>
            <li>
              <button class="btn btn-white btn-bitbucket"
                      ng-disabled="orderListCtrl.pageNo== orderListCtrl.pageResult.totalPage"
                      ng-click="orderListCtrl.changePage(orderListCtrl.pageNo+1)">
                下一页
              </button>
            </li>
            <li>
              <button class="btn btn-white btn-bitbucket"
                      ng-disabled="orderListCtrl.pageNo== orderListCtrl.pageResult.totalPage"
                      ng-click="orderListCtrl.changePage(orderListCtrl.pageResult.totalPage)">
                尾页
              </button>
            </li>
          </ul>
        </div>
      </div>
      <p class="text-center" ng-hide=" orderListCtrl.totalNum != 0">查无结果</p>
    </div>
  </div>
</div>
